package day8.homework2;

public class Automobile {
    /**
     * 汽车类
     */
    //汽车品牌
    public String brand;
    //汽车颜色
    public String colour;
    //汽车牌照
    public String number;

    public Automobile(){

    }
    public Automobile(String brand,String colour,String number){
        this.brand = brand;
        this.colour = colour;
        this.number = number;
    }
    public void punish(Driver driver, Trafficpolice taxbureau, Violation violation){
        System.out.println("驾驶牌照为："+ this.number + "的"+ this.colour +
                "的" + this.brand +"的"+ driver.name +
                "被警号为"+ taxbureau.alarm +"的"+ taxbureau.name +"处罚：扣分" +
                violation.fine + "罚款"+ violation.buckle+ "元");
    }

    public static void main(String[] args) {
        //产生汽车类
        Automobile automobile = new Automobile("大众","白色","川A0000");
        Automobile automobile1 = new Automobile("宝马","黑色","川A1111");
        Automobile automobile2 = new Automobile("五菱","白色","川A2222");
        Automobile automobile3 = new Automobile("法拉利","红色","川A3333");
        //产生驾驶员类
        Driver driver = new Driver("赵师傅");
        Driver driver1 = new Driver("钱师傅");
        Driver driver2 = new Driver("孙师傅");
        Driver driver3 = new Driver("李师傅");
        //产生交警类
        Trafficpolice taxbureau = new Trafficpolice("000001","周警官");
        Trafficpolice taxbureau1 = new Trafficpolice("000002","吴警官");
        Trafficpolice taxbureau2 = new Trafficpolice("000003","郑警官");
        Trafficpolice taxbureau3 = new Trafficpolice("000004","王警官");
        //产生违章类
        Violation violation = new Violation(6,200);
        Violation violation1 = new Violation(0,200);
        Violation violation2 = new Violation(3,50);
        Violation violation3 = new Violation(3,200);

        automobile.punish(driver1,taxbureau2,violation2);
        automobile1.punish(driver,taxbureau,violation);
        automobile2.punish(driver3,taxbureau1,violation3);
        automobile3.punish(driver2,taxbureau3,violation1);
    }
}
